package com.demo;

public class BasicConstructs {
	
	public static void whileTest(){
		
		int count =10;
		
		while(count < 10){  //while(condition)
			System.out.println("whileTest count value :" + count);
			count++;
		}
		
		System.out.println("After the whileTest");
		
	}
	
	
	public static void doWhileTest(){
		
		int count =10;
		
		do{
			
			System.out.println("doWhileTest count value :" + count);
			count++;
		}while(count <10);
		
		
	}
	
	public static void forTest(){
		
		int count =10;
		for(count = 10; count >0 ; count--)   //for(initialization block;  termination condition; increment condition) 
			                                 //for( ;   ;)  is a valid statement but goes into infinite loop
		{
			
			System.out.println("count in forTest :" + count);
		}
	
	
		
	}
	
	public static void ifTest(){
		int count =5;
		char myChar ='h';
		if( myChar == 'h'){
			System.out.println("count is greater than ");
		}
		else if (true) {
			do{
				System.out.println("test");
			}while(true);
			
		}
		
	}
	
	public static void switchTest(){
		
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	
		 BasicConstructs.whileTest();
		 BasicConstructs.doWhileTest();
		 BasicConstructs.forTest();

	}

}
